module.exports = angular.module 'messagePush.index', []
.config ($stateProvider)->
  $stateProvider
  .state 'index.messagePush',
    url: '/messagePush'
    abstract: true
    template: '<div ui-view>'
    controller: 'MessagePushIndexCtrl'
    resolve:
      _setTitle: ($rootScope)-> $rootScope.$title = "消息推送管理"
      loadMessagePushIndexCtrl: ($q, $ocLazyLoad)->
        return $q (resolve)->
          require.ensure [], ->
            module = require './messagePush.ctrl.coffee'
            $ocLazyLoad.load name: 'messagePush'
            resolve module.controller
  .state 'index.messagePush.list',
    url: '/list'
    templateProvider: ($q)->
      return $q (resolve)->
        require.ensure [], ->
          resolve require('../../../../views/index/message/list.jade')()
    controller: 'MessagePushListCtrl'
    resolve:
      _setTitle: ($rootScope)-> $rootScope.$title = "消息推送列表"
      loadMessagePushListCtrl: ($q, $ocLazyLoad)->
        return $q (resolve)->
          require.ensure [], ->
            module = require './messagePush.list.ctrl.coffee'
            $ocLazyLoad.load name: 'messagePush.list'
            resolve module.controller
    ncyBreadcrumb:
      label: "消息推送列表"
  .state 'index.messagePush.new',
    url: '/new'
    templateProvider: ($q)->
      return $q (resolve)->
        require.ensure [], ->
          resolve require('../../../../views/index/message/new.jade')()
    controller: 'MessagePushNewCtrl'
    resolve:
      _setTitle: ($rootScope)-> $rootScope.$title = "新建推送任务"
      loadMessagePushNewCtrl: ($q, $ocLazyLoad)->
        return $q (resolve)->
          require.ensure [], ->
            module = require './messagePush.new.ctrl.coffee'
            $ocLazyLoad.load name: 'messagePush.new'
            resolve module.controller
    ncyBreadcrumb:
      label: "消息推送详情"
      parent: "index.messagePush.list"
  .state 'index.messagePush.view',
    url: '/:messagePushId/view'
    templateProvider: ($q)->
      return $q (resolve)->
        require.ensure [], ->
          resolve require('../../../../views/index/message/view.jade')()
    controller: 'MessagePushViewCtrl'
    resolve:
      _setTitle: ($rootScope)-> $rootScope.$title = "消息推送详情"
      loadMessagePushNewCtrl: ($q, $ocLazyLoad)->
        return $q (resolve)->
          require.ensure [], ->
            module = require './messagePush.view.ctrl.coffee'
            $ocLazyLoad.load name: 'messagePush.view'
            resolve module.controller
    ncyBreadcrumb:
      label: "消息推送详情"
      parent: "index.messagePush.list"
